package cn.secby.orders.service.impl;
import cn.secby.common.core.web.mapper.WrapperParse;
import java.util.List;
import cn.secby.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.secby.orders.mapper.ReturnOrderMapper;
import cn.secby.orders.domain.ReturnOrder;
import cn.secby.orders.service.IReturnOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Arrays;

/**
 * 订单退货Service业务层处理
 * @author shenkunlin
 * @date 2025-05-06
 */
@Service
public class ReturnOrderServiceImpl extends ServiceImpl<ReturnOrderMapper, ReturnOrder> implements IReturnOrderService
{
    @Autowired
    private ReturnOrderMapper returnOrderMapper;

    /**
     * 查询订单退货
     * @param id 订单退货主键
     * @return 订单退货
     */
    @Override
    public ReturnOrder selectReturnOrderById(Long id)
    {
        return getById(id);
    }

    /**
     * 查询订单退货列表
     * @param returnOrder 订单退货
     * @return 订单退货
     */
    @Override
    public List<ReturnOrder> selectReturnOrderList(ReturnOrder returnOrder)
    {
        return list(WrapperParse.query(returnOrder));
    }

    /**
     * 新增订单退货
     * @param returnOrder 订单退货
     * @return 结果
     */
    @Override
    public Boolean insertReturnOrder(ReturnOrder returnOrder)
    {
        return save(returnOrder);
    }

    /**
     * 修改订单退货
     * @param returnOrder 订单退货
     * @return 结果
     */
    @Override
    public Boolean updateReturnOrder(ReturnOrder returnOrder)
    {
        return updateById(returnOrder);
    }

    /**
     * 批量删除订单退货
     * @param ids 需要删除的订单退货主键
     * @return 结果
     */
    @Override
    public Boolean deleteReturnOrderByIds(List<Long> ids)
    {
        return removeByIds(ids);
    }

    /**
     * 删除订单退货信息
     * @param id 订单退货主键
     * @return 结果
     */
    @Override
    public Boolean deleteReturnOrderById(Long id)
    {
        return removeById(id);
    }
}
